package com.quartet.utils;

import cn.hutool.core.thread.ThreadUtil;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.Executor;

/**
 * @ClassName ThreadPoolExecutor
 * @Description
 * @Author huipanxing  @Date 2021/6/16 16:15
 */
@Component
public class MyThreadPoolExecutor {

    private int corePoolSize = 10;

    private int maximumPoolSize = 20;


    @PostConstruct
    public Executor getAsyncExecutor() {
        return ThreadUtil.newExecutor(corePoolSize, maximumPoolSize);
    }

}
